package com.koala.common.core.utils;

import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;

@Builder
@ToString
@Accessors(chain = true)
@AllArgsConstructor
public  class RT<T> implements Serializable {
    private static final long serialVersionUID = 1L;

    @Getter
    @Setter
    private Integer code =0;
    @Getter
    @Setter
    private String msg ="success";
    @Getter
    @Setter
    private T data;

    public  RT() {
        super();
    }
    public RT(T data) {
        super();
        this.data=data;
    }
    public RT(T data ,String msg) {
        super();
        this.data=data;
        this.msg=msg;
    }

    public RT(Throwable e) {
        super();
        this.msg=e.getMessage();
        this.code=1;
    }
}
